{% extends "site_base.html" %}
{% block body %}
	<div id="page-container">
                  <!-- Lewa kolumna  -->
			<!-- Posty -->
		        {% if object_list%}
			    {% for post in object_list %}
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>{{ post.tytul }}</span>
                                        </span>
                                    </div>
                                    <div class="box-content">
                                        <div class="text">
					{% autoescape off %}
                             		    {{ post.tresc|truncatewords:150  }}
					{% endautoescape %}
                                        </div>
                                        <hr />
                                        <div class="line">
                                            <span class="button-border"><span class="date alert"> {{ post.dataDodania.date }}</span></span>
                                            <span class="content">
                                                <strong>Autor:</strong> <span class="color-gray">{{ post.autor.first_name }} {{ post.autor.last_name }}</span><br />
                                                <strong>Tagi:</strong> 
						    <span class="color-gray">
						    {% for tag in post.tagi.all %} 
							<a href = "{{ tag.get_absolute_url }}"> {{ tag.nazwa }} </a> 
						    {% endfor %}
						   </span>
						   
                                            </span>
                                            <span class="button-border buttons"><span class="button"><a href="{{ post.get_absolute_url }}">czytaj dalej</a></span></span>
					    {% if post.czyKomentarz %}
                                            <span class="comments">
						{% if post.liczba_komentarzy %}
							<p>komentarze:{{ post.liczba_komentarzy }}</p>
						{% else %}
							<p>brak komentarzy</p>
						{% endif %}
					    </span>
					   {% endif %}
                                        </div>
                                        
                                    </div>
                                </div>
                            </div>
			   {% endfor %}
		       {% endif %}
                       <!-- Posty Koniec -->
                <!-- Lewa kolumna Koniec -->
		 <div>
	        <div>Strona {{ page}} z {{ pages }}</div>
	        <div>{% if has_previous %}<a href="?page={{ previous }}"> <--poprzednia </a>{% endif %}</div>
	        <div>{% if has_next %}<a href="?page={{ next }}"> nastepna--> </a>{% endif %}</div>
	     </div>
                </div>
                <div id="page-container-2">
                        <!-- Prawa kolumna START -->
                            <!-- Autor -->
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>Archiwum</span>
                                        </span>
                                        <span class="box-header-icons">
                                            <img class="box-header-minimize" alt="minimize" src="{{ MEDIA_URL }}css/gfx/icons/minimize-transparent.png" />
                                            <img class="box-header-close" alt="close" src="{{ MEDIA_URL }}css/gfx/icons/close-transparent.png" />
                                        </span>
                                    </div>
                                    <div class="box-content">
                                        <p class="half-line">
                                            <span class="content color-orange strong tag-normal">
                                                » <a href="{% url posty_arch year=rok1 month=miesiac1 %}">{{ date1|date:"M Y" }}</a>
                                            </span>
                                            <span class="icons">
                                                <img class="icon-show" alt="show" src="{{ MEDIA_URL }}css/gfx/icons/show-white.gif" />
                                            </span>
                                            <span class="color-gray positions"></span>
                                        </p>
                                        <hr />
                                        <p class="half-line">
                                            <span class="content strong tag-normal">
                                                » <a href="{% url posty_arch year=rok2 month=miesiac2 %}"> {{ date2|date:"M Y" }}</a>
                                            </span>
                                            <span class="icons">
                                                <img class="icon-show" alt="show" src="{{ MEDIA_URL }}css/gfx/icons/show-white.gif" />
                                            </span>
                                            <span class="color-gray positions"></span>
                                        </p>
                                        <hr />
                                        <p class="half-line">
                                            <span class="content strong tag-normal">
                                                » <a href="{% url posty_arch year=rok3 month=miesiac3 %}"> {{ date3|date:"M Y" }}</a>
                                            </span>
                                            <span class="icons">
                                                <img class="icon-show" alt="show" src="{{ MEDIA_URL }}css/gfx/icons/show-white.gif" />
                                            </span>
                                            <span class="color-gray positions"></span>
                                        </p>
                                        <hr />
                                        <p class="half-line">
                                            <span class="content strong tag-normal">
                                                » <a href="{% url posty_najstarsze %}"> Starsze </a>
                                            </span>
                                            <span class="icons">
                                                <img class="icon-show" alt="show" src="{{ MEDIA_URL }}css/gfx/icons/show-white.gif" />
                                            </span>
                                            <span class="color-gray positions"></span>
                                        </p>
                                        <p class="buttons">
                                            <span class="button-border"><span class="button"><a href="{% url post_dodaj %}">dodaj post</a></span></span>
                                        </p>
                                    </div>
                                    <p class="size-icon"><img class="icon-size" alt="change-size" src="{{ MEDIA_URL }}css/gfx/icons/size-white.gif" /></p>
                                </div>
                            </div>
                            <!-- Autor KONIEC -->


		            <!-- Kategorie -->
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>Kategorie</span>
                                        </span>
                                        <span class="box-header-icons">
                                            <img class="box-header-minimize" alt="minimize" src="{{ MEDIA_URL }}css/gfx/icons/minimize-transparent.png" />
                                            <img class="box-header-close" alt="close" src="{{ MEDIA_URL }}css/gfx/icons/close-transparent.png" />
                                        </span>
                                    </div>
                                    <div class="box-content">
					<span class="tag-big strong"><a href="{% url posty_glowny %}">najciekawsze</a> </span>
                                        {% for kat in kategorie %}
						<a href = "{{ kat.get_absolute_url }}"> {{ kat.nazwa }} </a>
					{% endfor %}
                                    </div>
                                    <p class="size-icon"><img class="icon-size" alt="change-size" src="{{ MEDIA_URL }}css/gfx/icons/size-white.gif" /></p>
                                </div>
                            </div>
                            <!-- Kategorie KONIEC -->

                            <!-- Tagi -->
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>Tagi</span>
                                        </span>
                                        <span class="box-header-icons">
                                            <img class="box-header-minimize" alt="minimize" src="{{ MEDIA_URL }}css/gfx/icons/minimize-transparent.png" />
                                            <img class="box-header-close" alt="close" src="{{ MEDIA_URL }}css/gfx/icons/close-transparent.png" />
                                        </span>
                                    </div>
                                    <div class="box-content">
					{% for tag in tagi %}
						<span class="{{wielkosc|random}}"><a href = "{{ tag.get_absolute_url }}"> {{ tag.nazwa }} </a></span>
					{% endfor %}
                                    </div>
                                    <p class="size-icon"><img class="icon-size" alt="change-size" src="{{ MEDIA_URL }}css/gfx/icons/size-white.gif" /></p>
                                </div>
                            </div>
                            <!-- Tagi KONIEC -->
                            <!-- Prawa kolumna KONIEC -->
		</div>
{% endblock %}
